<template>
  <div class="Comment">
    <div class="item">
      <img :src="item.user.avatarUrl" />
    </div>
    <div class="wrap">
      <div class="user">{{ item.user.nickname }}</div>
      <div class="time">{{ item.time | dCreateTime }}</div>

      <div class="coment">
        <h3>{{ item.content }}</h3>
      </div>
    </div>

    <div class="assist iconfont">
      {{ item.likedCount }}
    </div>
  </div>
</template>
<script>
export default {
  name: "Comment",
  props: ["item"],
  data() {
    return {};
  },
  filters: {
    dCreateTime(value) {
      var date = new Date(parseInt(value));
      var Y = date.getFullYear() + "年";
      var M =
        (date.getMonth() + 1 < 10
          ? "0" + (date.getMonth() + 1)
          : date.getMonth() + 1) + "月";
      var D = date.getDate() + "日";
      var df = Y + M + D;
      return df;
    },
  },
};
</script>
<style lang="less" scoped>
.Comment {
  display: flex;
  width: 55vh;
  padding-left: 5px;
  .item {
    height: 70px;
    width: 45px;
    position: relative;
    padding-right: 5px;
    img {
      display: block;
      border-radius: 50%;
      width: 35px;
      height: 35px;
    }
  }

  .wrap {
    width: 100%;
    color: #666666;
    .user {
      font-size: 14px;
      padding-bottom: 5px;
      padding-top: 5px;
    }
    .time {
      font-size: 13px;
    }

    .coment {
      font-size: 16px;
      color: #333;
      padding-top: 10px;
    }
  }
  .assist {
    width: 65px;
    height: 22px;
    line-height: 22px;
    font-size: 11px;
    color: #999;
    -webkit-flex: none;
    -webkit-box-flex: 0;
    flex: none;
    vertical-align: middle;
    text-align: right;
    &::after {
      content: "\e605";
      font-size: 18px;
      font-style: normal;
      display: inline-block;
      width: 14px;
      height: 14px;
      margin-left: 6px;
      line-height: 0;
      cursor: pointer;
    }
  }
}
</style>